/*
 * timer.c
 *
 *  Created on: 02.11.2012
 *      Author: AigeR780
 */
#include "timer.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>


void timer_init()
{
	/* capture compare match OCR1A */
	TCCR1A |= (1<<WGM12)|(1<<WGM13);

	/* 1/8 prescaler */
	TCCR1B |= (1<<CS11);

	/* output compare grenze*/
	OCR1AL = 200;

	/* output compare interupt enable*/
	TIMSK1 |= (1<<OCIE1A);
}



//ISR(USART1_TX_vect)
ISR(TIMER1_COMPA_vect)
/************************************************************************
Function: UART Data Register Empty interrupt
Purpose:  called when the UART is ready to transmit the next byte
*************************************************************************/
{
	TCNT1 = 0;
}
